// source --> https://healthpages.co.nz/wp-content/plugins/sabai/assets/js/sabai.min.js var SABAI=SABAI||{};!function(e){if(SABAI.console=window.console||{log:function(e){alert(e)}},SABAI.isRTL=!1,SABAI.init=function(){var a=function(a){SABAI.fadeout(e(".sabai-fadeout",a))},t=function(a){e("input.sabai-form-check-trigger",a).show().click(function(){var a=e(this);a.closest("table").find("input.sabai-form-check-target, input.sabai-form-check-trigger").not(":disabled").prop("checked",a.prop("checked"))})},i=function(a){e("fieldset.sabai-form-collapsible",a).not(".sabai-form-collapsible-processed").each(function(){var a=e(this);a.find("> legend span:first").prepend(' ').wrap('').end().find("a.sabai-form-collapsible:first").click(function(){return e(this).toggleClass("sabai-form-collapsed").find("i").toggleClass("fa-caret-down").toggleClass(SABAI.isRTL?"fa-caret-left":"fa-caret-right").end().closest(".sabai-form-collapsible-processed").toggleClass("sabai-form-collapsed").find(".sabai-form-fields:first").slideToggle("fast",function(){e(this).find("textarea:visible").autosize()}),!1}).end().addClass("sabai-form-collapsible-processed"),a.hasClass("sabai-form-collapsed")&&(a.hasClass("sabai-form-field-error")?a.removeClass("sabai-form-collapsed"):a.find(".sabai-form-fields:first").css({display:"none"}).end().find("a.sabai-form-collapsible:first").addClass("sabai-form-collapsed").find("i").removeClass("fa-caret-down").addClass(SABAI.isRTL?"fa-caret-left":"fa-caret-right"))})},n=function(a){e("textarea:visible",a).autosize()},s=function(a){var t="ontouchstart"in document.documentElement;t||e('[rel="sabaitooltip"]',a).each(function(){var t=e(this),i="sabai-content"===a.attr("id")&&t.closest("#sabai-inline-content").length?t.closest("#sabai-inline-content"):t.data("container")||a;t.sabaitooltip({container:i})}),e("a[data-popover-url]",a).bind("click",function(t){var i=e(this).unbind("hover"),n={html:!0,container:"sabai-content"===a.attr("id")&&i.closest("#sabai-inline-content").length?i.closest("#sabai-inline-content"):i.data("container")||a,url:i.data("popover-url")};SABAI.isRTL?n.placement=function(a,t){return e(t).offset().left>300?"left":"auto"}:n.placement=function(a,t){var i=e(t);return window.innerWidth-(i.offset().left+i.innerWidth())>300?"right":"auto"},SABAI.popover(i,n),t.preventDefault()})},o=function(a){e("a.sabai-toggle",a).not(".sabai-toggle-processed").unbind("click").click(function(a){var t=e(this).addClass("sabai-toggle-processed"),i=e(t.data("toggle-target"));if(e.trim(i.html())){e(SABAI).trigger("toggle.sabai",{trigger:t,target:i});var n=t.data("toggle-cookie"),s=t.hasClass("sabai-toggle-slide")?"slideToggle":"toggle";i[s]("fast",function(){var a=i.is(":visible");t.toggleClass("sabai-active",a),n&&e.cookie(n,a?1:0,{path:SABAI.path,domain:SABAI.domain}),e(SABAI).trigger("toggled.sabai",{trigger:t,target:i})}),a.preventDefault()}})},r=function(a){e(".sabai-carousel",a).each(function(){var a=e(this);a.data("carousel",a.bxSlider(a.data("carousel-options")||{})),e(SABAI).bind("entity_filter_form_toggled.sabai",function(e,t){a.parents(t.container).length&&a.data("carousel").redrawSlider()})})},l=function(a){e("a.sabai-form-field-add",a).each(function(){var a=e(this),t=a.closest(".sabai-form-fields"),i=parseInt(a.data("field-max-num"));a.click(function(e){var n=a.data("field-next-index");SABAI.cloneField(t,a.data("field-name"),i,n,a),n&&a.data("field-next-index",++n),e.preventDefault()}),t.find("> .sabai-form-field:not(.sabai-form-field-add)").each(function(n){0!==n&&e(this).append('').find("a.sabai-form-field-remove").click(function(n){e(this).closest(".sabai-form-field").fadeTo("fast",0,function(){e(this).slideUp("fast",function(){e(this).remove(),i&&t.find("> .sabai-form-field:not(.sabai-form-field-add)").length .sabai-form-field:not(.sabai-form-field-add)").length>=i&&a.hide()})};return function(c,d){a(c),t(c),i(c),n(c),s(c),o(c),r(c),l(c),"function"==typeof prettyPrint&&prettyPrint(),"function"==typeof e.fn.prettyPhoto&&e('a[rel^="prettyPhoto"]',c).prettyPhoto(),e(".sabai-dropdown-toggle",c).sabaidropdown(),e(".sabai-click",c).click(),d&&d.call(null,c),e(SABAI).trigger("sabai_init.sabai",{context:c})}}(),SABAI.fadeout=function(a,t){t=t||6e3,e(a).animate({opacity:"+=0"},t,function(){e(this).fadeOut("fast",function(){e(this).remove()})})},SABAI.cache=function(){var e={};return function(a,t,i){return 1==arguments.length?e[a]?e[a].expires<(new Date).getTime()?!1:e[a].data:!1:(i=i||600,void(e[a]={data:t,expires:(new Date).getTime()+1e3*i}))}}(),SABAI.flash=function(a,t,i){if("undefined"!=typeof a&&null!==a)if("string"==typeof a)e.growl(a,{type:t,delay:"danger"===t?0:void 0!==i?i:5e3,z_index:999999});else for(var n=0;n
',t.url){var n=SABAI.cache(t.url);n?t.content=n:(t.content=" ",e.get(t.url,{__ajax:1},function(e){SABAI.cache(t.url,e),a.attr("data-content",e).data("bs.sabaipopover").tip().find(".sabai-popover-content").html(e),a.sabaipopover("show")}))}a.sabaipopover(t).sabaipopover("show").addClass("sabai-popover-processed").data("bs.sabaipopover").tip().css(t.width?{width:t.width}:{}).find(".sabai-close").on("click",function(){a.data("bs.sabaipopover").hide()}),SABAI.popoverInit||(e("body").on("click",function(a){e(".sabai-popover-processed").each(function(){e(this).is(a.target)||0!==e(this).has(a.target).length||0!==e(".sabai-popover").has(a.target).length||e(this).sabaipopover("hide")})}),SABAI.popoverInit=!0)}},SABAI.modal=function(){var a,t=function(){var a=e('').prependTo("body").find(".sabai-close").mousedown(function(){e("#sabai-modal").fadeOut("fast",function(){e(this).remove()})}).end();return e(document).keyup(function(a){27==a.keyCode&&e("#sabai-modal").find(".sabai-close").mousedown()}),a},i=function(e,a){var t,i,n=document.documentElement.clientWidth<=768?.95:.8;(null===a||a>document.documentElement.clientWidth*n)&&(a=document.documentElement.clientWidth*n),e.find(".sabai-modal-container").css({width:a+"px",left:SABAI.isRTL?"auto":document.documentElement.clientWidth/2-a/2,right:SABAI.isRTL?document.documentElement.clientWidth/2-a/2:"auto",top:.07*document.documentElement.clientHeight}),i=e.find(".sabai-form-buttons").length?e.find(".sabai-form-buttons").outerHeight()+10:20,e.find(".sabai-modal-footer").css("height",i+"px"),t=.8*document.documentElement.clientHeight-e.find(".sabai-modal-title").outerHeight()-i,e.find(".sabai-modal-content").css("max-height",t+"px"),e.get(0).scrollHeight>document.documentElement.clientHeight&&e.find(".sabai-modal-content").css("height",t+"px")};return function(n,s,o,r){return a=r?r:e("body").has("#sabai-modal").length?e("#sabai-modal"):t(),(s||n)&&(s&&a.find(".sabai-modal-title > span:first").text(s),n&&a.find(".sabai-modal-content").html(n),a.show()),"undefined"!=typeof o&&(0===o&&(o=a.find(".sabai-modal-container").width()),i(a,o)),a}}(),SABAI.ajaxLoader=function(a,t,i){var n=e(a);if(i){var s=e(i);if(!s.length)return;if(t)s.next(".sabai-ajax-loader").remove();else{var o=e('
').css("top",parseInt(s.position().top,10)+parseInt(s.css("margin-top"),10)+"px").width(s.outerWidth()).height(s.outerHeight());s.after(o)}n.length&&n.blur().prop("disabled",!t).css("pointer-events",t?"auto":"none")}else{if(!n.length)return;n.blur().prop("disabled",!t).css("pointer-events",t?"auto":"none").toggleClass("sabai-ajax-loading",!t)}},SABAI.ajax=function(a){var t,i,n,s=e.extend({trigger:null,async:!0,type:"get",url:"",data:"",processData:!0,target:"",container:null,modalWidth:null,cache:!1,cacheLifetime:600,onSendData:null,onSuccess:null,onError:null,onErrorFlash:!0,onContent:null,onSuccessFlash:!1,onReadyState:null,effect:null,scroll:!1,replace:!1,highlight:!1,callback:!1,loadingImage:!0,position:!1,toggle:!1,pushState:!1,state:{}},a),o="",r=0,l=function(a,t){try{var i=JSON.parse(a.replace(//g,""));if(s.onSuccess&&!s.onSuccess(i,t,s.trigger))return void(s.onSuccessFlash&&i.messages&&SABAI.flash(i.messages,"success"));if(i.url)return"#sabai-modal"===s.container&&e("#sabai-modal").hide(),void(window.location=i.url);s.onSuccessFlash&&i.messages&&SABAI.flash(i.messages,"success")}catch(n){SABAI.console.log("Failed parsing response:

"+a.toString().replace(//g,">")+"

"+n.toString()+"

")}},c=function(a,t){if("#sabai-modal"===s.container){if(s.trigger){var i=s.trigger.attr("data-modal-title");("undefined"==typeof i||i===!1)&&(i=s.trigger.attr("title")||s.trigger.attr("data-original-title")||""),SABAI.modal(a,i,s.modalWidth,t)}else SABAI.modal(a,"",s.modalWidth,t);s.onContent||(s.onContent=function(e,a,t){a.focusFirstInput()}),s.onContent(a,t,s.trigger)}else{if(s.trigger&&s.trigger.hasClass("sabai-toggle")&&e(SABAI).trigger("toggle.sabai",{trigger:s.trigger,target:t}),s.replace)s.scroll&&o&&SABAI.scrollTo(o),t=t.hide().after(a).remove().next(),s.onContent&&s.onContent(a,t,s.trigger);else{switch(s.callback||"sabai-content"==t.attr("id")||"sabai-inline-content"==t.attr("id")||t.addClass("sabai-ajax"),s.effect){case"slide":t.hide().html(a).slideDown("fast",function(){s.onContent&&s.onContent(a,t,s.trigger)});break;default:t.html(a).show(),s.onContent&&s.onContent(a,t,s.trigger)}s.scroll&&o&&SABAI.scrollTo(o)}if(s.highlight&&t.effect("highlight",{},1500),s.trigger&&s.trigger.hasClass("sabai-toggle")){var n=t.is(":visible");s.trigger.removeAttr("onclick").removeClass("sabai-click").toggleClass("sabai-active",n);var r=s.trigger.data("toggle-cookie");r&&e.cookie(r,n?1:0,{path:SABAI.path,domain:SABAI.domain}),e(SABAI).trigger("toggled.sabai",{trigger:s.trigger,target:t})}}if(s.pushState&&window.history&&window.history.pushState){var l=SABAI.parseUrl(s.url);l.pathname!==location.pathname&&(l.pathname=location.pathname),s.state.data=s.data,s.state.url=s.url,s.state.container=s.container,s.state.target=s.target,window.history.pushState(s.state,null,l.toString())}SABAI.init(t),e(SABAI).trigger("loaded.sabai",{target:t,selector:o})},d=function(e,a){try{var t=JSON.parse(e.replace(//g,""));if(s.onError){if(!s.onError(t,a,s.trigger))return void(s.onErrorFlash&&t.messages&&SABAI.flash(t.messages,"danger"))}else if(t.url)return void(window.location=t.url);s.onErrorFlash&&t.messages&&(s.trigger?(SABAI.popover(s.trigger,{content:t.messages[0],html:!0,container:s.trigger.closest(".sabai"),title:s.trigger.attr("data-sabaipopover-title")||""}),s.trigger.attr("onclick","return false;")):SABAI.flash(t.messages,"danger"))}catch(i){SABAI.console.log("Failed parsing response:

"+e.toString().replace(//g,">")+"

"+i.toString()+"

")}};if(s.trigger){if(s.trigger.hasClass("sabai-disabled"))return;s.trigger.data("cookie-name")&&s.trigger.data("cookie-value")&&e.cookie(s.trigger.data("cookie-name"),s.trigger.data("cookie-value"),{path:SABAI.path,domain:SABAI.domain}),s.url||(s.url=s.trigger.data("sabai-remote-url")),s.trigger.hasClass("sabai-dropdown-link")&&(s.trigger=s.trigger.closest(".sabai-btn-group").find(".sabai-dropdown-toggle"))}if(s.url){if(s.container)if(o=s.container,"#sabai-modal"===s.container)t=SABAI.modal();else if(s.target?(t=e(s.container).find(s.target),o=s.container+" "+s.target):t=e(s.container),!t.length)return void SABAI.console.log(o);if(s.cache&&"get"===s.type){var f=SABAI.cache(s.container+s.url);if(f)return void c(f,t)}s.onSendData&&("object"!=typeof s.data&&(s.data={}),s.onSendData(s.data,s.trigger)),"object"==typeof s.data?(s.data.hasOwnProperty("__ajax")||(s.data.__ajax=o||1),s.data=e.param(s.data)):"string"==typeof s.data&&""!==s.data?s.data+="&__ajax="+(o?encodeURIComponent(o):1):s.data="__ajax="+(o?encodeURIComponent(o):1),e.ajaxreadystate({global:!0,async:s.async,type:s.type,dataType:"html",url:s.url,data:s.data,processData:s.processData,cache:!1,beforeSend:function(e){s.loadingImage&&(t&&"sabai-content"!==t.attr("id")&&t.is(":visible")?(i="sabai-modal"===t.attr("id")?t.find(".sabai-modal-content"):t,SABAI.ajaxLoader(s.trigger,!1,i)):SABAI.ajaxLoader(s.trigger))},complete:function(e,a){switch(s.loadingImage&&SABAI.ajaxLoader(s.trigger,!0,s.replace?o:i),a){case"success":if("undefined"!=typeof n){s.loadingImage&&SABAI.ajaxLoader(s.trigger,!0);break}278==e.status||e.getResponseHeader("content-type").indexOf("json")>-1?l(e.responseText,t):(c(e.responseText,t),"get"==s.type&&s.cache&&SABAI.cache(s.container+s.url,e.responseText,s.cacheLifetime));break;case"error":d(e.responseText,t)}},readystate:function(e,a){if(s.onReadyState&&a>2&&4>a&&-1!==e.getResponseHeader("Content-Type").indexOf("application/json")){++r;var i="undefined"!=typeof n?e.responseText.substring(n.length):e.responseText;try{var o=JSON.parse(i.replace(//g,""));s.onReadyState(o,t,s.trigger,r)}catch(l){SABAI.console.log(l.toString())}n=e.responseText}}})}},SABAI.scrollTo=function(a,t,i){a=a instanceof jQuery?a:e(a),t="undefined"!=typeof t&&null!==t?t:1e3,i="undefined"!=typeof i&&null!==i?i:0,e.sabaiScrollTo(a,t,{offset:{top:i}})},SABAI.states=function(a,t){var i=[],n={visible:"invisible",enabled:"disabled",unchecked:"checked",unload_options:"load_options",show_options:"hide_options"},s=function(a,t,n,s){var r=e(a,s);r.length&&r.each(function(){var a,r,l,c,d,f,u,g=e(this);g.data("guid")||g.data("guid",SABAI.guid());for(a in n)if(c=n[a],f=".sabai-cloned",l=g.closest(f),l.length||(f=c.container||"form",l=g.closest(f)),l.length)if(r=l.find(a),r.length){switch(d=["initialized.sabai"],c.type){case"selected":case"unselected":d.push("change","cloneremoved.sabai");break;case"checked":case"unchecked":d.push("change","cloneremoved.sabai","switchChange.bootstrapSwitch");break;case"focus":case"blur":d.push("focus","blur");break;case"request":case"requested":d.push("requested.sabai");break;case"values":case"count":default:d.push("keyup","change","cloneremoved.sabai")}i.push(r);for(var p=0;pr;r++){for(var c=0;o>c;c++)if("object"!=typeof i[r]){if(i[r]==n[c]){if("value"===t)return!0;continue e}}else if(l(i[r][0],n[c],i[r][1])){if("value"===t)return!0;continue e}if("values"===t)return!1}return"values"===t?!0:!1;case"count":var n=[];return a.each(function(){"checkbox"===this.type||"radio"===this.type?this.checked&&n.push(this.value):n.push(e(this).val())}),n.length===i;case"checked":case"unchecked":var d=!1;return a.each(function(){return e(this).prop("checked")===Boolean(i)?(d=!0,!1):void 0}),"checked"===t?d:!d;case"empty":case"filled":case"selected":var d=!1;return a.each(function(){return""===e.trim(e(this).val())===Boolean(i)?(d=!0,!1):void 0}),"empty"===t?d:!d;case"request":return a.data("request-url")&&a.data("request-result")===i;case"requested":if(a.data("request-url")){var d=a.data("request-result");return("success"===d||"error"===d)===Boolean(i)}return!1;case"focus":return a.is(":focus")===Boolean(i);case"blur":return a.is(":focus")!==Boolean(i);default:return alert("Invalid condition type: "+t),!1}},l=function(e,a,t){switch(t){case"==":return e==a;case"!=":return e!=a;case"<":return a>e;case">":return e>a}},c=function(a,t,i,n,s,o){switch(t){case"invisible":a.toggleClass("sabai-form-states-invisible",i),i?o?a[a.hasClass("sabai-has-error")?"show":"hide"]():a.hide():a.is(":hidden")&&(o?a.show():(a.css("opacity",0).slideDown(100).animate({opacity:1},{queue:!1,duration:"slow"}),a.hasClass("sabai-form-field")&&a.parent(".sabai-form-inline").length&&a.css("display","inline-block")));break;case"disabled":a.toggleClass("sabai-form-states-disabled",i);break;case"checked":a.find(":checkbox").prop("checked",i).change();break;case"load_options":if("change"!==s&&"initialized"!==s)return;var r=a.find("select");if(r.find('option[value!=""]').remove(),i){var l=r.data("load-url"),c=l+n.val(),d=SABAI.cache(c),f=r.data("options-prefix")||"",u=function(t){if(SABAI.cache(c,t),"undefined"!=typeof t&&0===t.length)return r.data("show-empty")||a.addClass("sabai-hidden"),r.data("default-value","").val(""),void r.trigger("change",[o]);if(e.each(t,function(a,t){r.append(e("").text(f+t[1]).val(t[0]))}),!a.closest(".sabai-cloned").length){var i=r.data("default-value");"undefined"!=typeof i&&(r.val(i),r.trigger("change",[o]))}if(!a.hasClass("sabai-form-states-invisible")&&a.is(":hidden")&&r.find('option[value!=""]').length){a.removeClass("sabai-hidden").addClass("sabai-was-hidden");var n=a.hasClass("sabai-form-field")&&a.parent(".sabai-form-inline").length?"inline":"block";o?a.css("display",n):a.hide().css("display",n).fadeIn("fast")}};d!==!1?u(d):(n.addClass("sabai-ajax-loading"),e.getJSON(l,{value:n.val()},u).always(function(){n.removeClass("sabai-ajax-loading")}))}else!a.is(":hidden")&&a.hasClass("sabai-was-hidden")&&(a.addClass("sabai-hidden"),r.data("default-value","").val(""),r.trigger("change",[o]));break;case"request_url":i?SABAI.ajax({target:a,url:a.data("request-url"),onSuccess:function(e,t,i){a.data("request-result","success").trigger("requested.sabai")},onError:function(e,t,i){a.data("request-result","error").trigger("requested.sabai")},onContent:function(e,t,i){a.data("request-result","error").trigger("requested.sabai")}}):a.data("request-result","");break;case"hide_options":var g=[];if(n.each(function(){"checkbox"===this.type||"radio"===this.type?this.checked&&g.push(this.value):g.push(e(this).val())}),!i||!g.length)return;a.find("input").each(function(){var a=e(this),t=a.data("values"),i=a.closest(".sabai-radio, .sabai-checkbox");if(i.length){for(var n=0;n .sabai-form-field:not(.sabai-form-field-add)"),l=n||r.length;if(!(i&&r.length>=i)){var c=r.first(),d=c.clone().addClass("sabai-cloned").attr("id","sabai-"+SABAI.guid()).find(":input").each(function(){var a=jQuery(this);a.attr("name")&&(field_name=s.data("field-form-wrap")?s.data("field-form-wrap")+"["+t+"]":t,a.attr("name",a.attr("name").replace(field_name+"[0]",field_name+"["+l+"]"))),a.attr("id")&&a.attr("id",a.attr("id")+"-"+l),a.removeData("default-value").removeAttr("data-default-value"),e.fn.uniform&&a.parent().is(".selector")&&a.prev("span").remove().end().unwrap().uniform().parent(".selector").show()}).end().clearInput().removeClass("sabai-form-field-error").find("span.sabai-form-field-error").remove().end().find(".sabai-was-hidden").hide().end().hide().insertAfter(r.last());d.append('').slideDown("fast").focusFirstInput().find("a.sabai-form-field-remove").click(function(a){e(this).closest(".sabai-form-field").fadeTo("fast",0,function(){e(this).slideUp("fast",function(){e(this).remove();var a=o.find("> .sabai-form-field:not(.sabai-form-field-add)");i&&a.length=i&&s.hide()}},SABAI.addOption=function(a,t,i,n,s){var o=e(a),r=e(i).closest(".sabai-form-field-option"),l=o.find("> .sabai-form-field-option"),c=n?t+"[default][]":t+"[default]",d=r.find("input[name='"+c+"']").val(),f=r.clone().find(":text").each(function(){var e=jQuery(this);e.attr("name")&&e.attr("name",e.attr("name").replace(t+"[options]["+d+"]",t+"[options]["+l.length+"]"))}).end().clearInput().find("input[name='"+c+"']").val(l.length).end().hide().insertAfter(r);return s&&s.call(null,f),f.slideDown("fast").focusFirstInput(),!1},SABAI.removeOption=function(a,t,i){var n=e(a).find("> .sabai-form-field-option:not(.sabai-form-field-option-disabled)");return 1===n.length?void n.clearInput():confirm(i)?void e(t).closest(".sabai-form-field-option").slideUp("fast",function(){e(this).remove()}):!1},SABAI.guid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var a=16*Math.random()|0,t="x"==e?a:3&a|8;return t.toString(16)})},window.history&&window.history.pushState){var a=!1,t=window.location.href.replace(/%2F/g,"/");e(window).on("popstate",function(i){if(a||(a=!0,location.href.replace(/%2F/g,"/")!=t)){var n=i.originalEvent.state;n?(n.data.__ajax=n.target?n.container+" "+n.target:n.container,SABAI.ajax(n),e(SABAI).trigger("sabaipopstate.sabai",n)):(e(window).off("popstate"),window.location.href=window.location.href)}})}SABAI.parseUrl=function(a){var t=a?e("").prop("href",a)[0]:window.location;if(t.query={},t.search&&"string"==typeof t.search){var i=t.search.substr(1).replace(/\+/g,"%20").split("&");e.each(i,function(e,a){var i=a.split("=");try{i[1]=decodeURIComponent(i[1])}catch(n){}t.query[i[0]]=i[1]})}return t},SABAI.getScript=function(a,t,i){return t=e.extend(t||{},{dataType:"script",cache:!0,url:a}),jQuery.ajax(t,i)},e.fn.sabai=function(){SABAI.init(this)},e.fn.focusTextRange=function(e,a){if(this.is('input[type="text"]')||this.is("textarea")){var t=this.get(0);if(t.setSelectionRange)t.focus(),t.setSelectionRange(e,a);else if(t.createTextRange){var i=t.createTextRange();i.collapse(!0),i.moveEnd("character",a),i.moveStart("character",e),i.select()}}return this},e.fn.focusFirstInput=function(){var e=this.find('input[type="text"],input[type="password"],textarea').not(".sabai-focus-off").filter(":visible:first");if(!e.length)return this;var a=e.val().length;return e.focusTextRange(a,a),this},e.fn.clearInput=function(){return this.each(function(){var a=e(this),t=a.get(0).tagName.toLowerCase();if("undefined"!=typeof a.data("default-value"))return void a.val(a.data("default-value"));if("input"===t){var i=a.attr("type");"checkbox"===i||"radio"===i?a.prop("checked",!1):a.val("")}else if("textarea"===t)a.val("");else{if("select"!==t)return a.find(":input").clearInput();a.prop("selectedIndex",0)}})}}(jQuery); // source --> https://healthpages.co.nz/wp-content/plugins/sabai-googlemaps/assets/js/infobox.min.js eval(function(p,a,c,k,e,r){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('7 8(a){a=a||{};r.s.1R.2k(2,3d);2.Q=a.1v||"";2.1H=a.1B||J;2.S=a.1G||0;2.H=a.1z||1h r.s.1Y(0,0);2.B=a.U||1h r.s.2E(0,0);2.15=a.13||t;2.1p=a.1t||"2h";2.1m=a.F||{};2.1E=a.1C||"3g";2.P=a.1j||"3b://38.r.33/2Y/2T/2N/1r.2K";3(a.1j===""){2.P=""}2.1f=a.1x||1h r.s.1Y(1,1);3(q a.A==="p"){3(q a.18==="p"){a.A=L}v{a.A=!a.18}}2.w=!a.A;2.17=a.1n||J;2.1I=a.2g||"2e";2.16=a.1l||J;2.4=t;2.z=t;2.14=t;2.V=t;2.E=t;2.R=t}8.9=1h r.s.1R();8.9.25=7(){5 i;5 f;5 a;5 d=2;5 c=7(e){e.20=L;3(e.1i){e.1i()}};5 b=7(e){e.30=J;3(e.1Z){e.1Z()}3(!d.16){c(e)}};3(!2.4){2.4=1e.2S("2Q");2.1d();3(q 2.Q.1u==="p"){2.4.O=2.G()+2.Q}v{2.4.O=2.G();2.4.1a(2.Q)}2.2J()[2.1I].1a(2.4);2.1w();3(2.4.6.D){2.R=L}v{3(2.S!==0&&2.4.Z>2.S){2.4.6.D=2.S;2.4.6.2D="2A";2.R=L}v{a=2.1P();2.4.6.D=(2.4.Z-a.W-a.11)+"12";2.R=J}}2.1F(2.1H);3(!2.16){2.E=[];f=["2t","1O","2q","2p","1M","2o","2n","2m","2l"];1o(i=0;ih){e=o.x+g+k+i-h}3(2.17){3(o.y<(-l+j+b)){I=o.y+l-j-b}v 3((o.y+l+j)>f){I=o.y+l+j-f}}v{3(o.y<(-l+j)){I=o.y+l-j}v 3((o.y+b+l+j)>f){I=o.y+b+l+j-f}}3(!(e===0&&I===0)){5 c=m.3a();m.39(e,I)}}}};8.9.1d=7(){5 i,F;3(2.4){2.4.37=2.1p;2.4.6.36="";F=2.1m;1o(i 35 F){3(F.34(i)){2.4.6[i]=F[i]}}2.4.6.32="31(0)";3(q 2.4.6.X!=="p"&&2.4.6.X!==""){2.4.6.2Z="\\"2X:2W.2V.2U(2R="+(2.4.6.X*1X)+")\\"";2.4.6.2P="2O(X="+(2.4.6.X*1X)+")"}2.4.6.U="2M";2.4.6.M=\'1c\';3(2.15!==t){2.4.6.13=2.15}}};8.9.1P=7(){5 c;5 a={1b:0,1g:0,W:0,11:0};5 b=2.4;3(1e.1s&&1e.1s.1W){c=b.2L.1s.1W(b,"");3(c){a.1b=C(c.1V,10)||0;a.1g=C(c.1U,10)||0;a.W=C(c.1T,10)||0;a.11=C(c.1S,10)||0}}v 3(1e.2I.N){3(b.N){a.1b=C(b.N.1V,10)||0;a.1g=C(b.N.1U,10)||0;a.W=C(b.N.1T,10)||0;a.11=C(b.N.1S,10)||0}}K a};8.9.2H=7(){3(2.4){2.4.2G.2F(2.4);2.4=t}};8.9.1y=7(){2.25();5 a=2.23().2C(2.B);2.4.6.W=(a.x+2.H.D)+"12";3(2.17){2.4.6.1g=-(a.y+2.H.1k)+"12"}v{2.4.6.1b=(a.y+2.H.1k)+"12"}3(2.w){2.4.6.M="1c"}v{2.4.6.M="A"}};8.9.2B=7(a){3(q a.1t!=="p"){2.1p=a.1t;2.1d()}3(q a.F!=="p"){2.1m=a.F;2.1d()}3(q a.1v!=="p"){2.1Q(a.1v)}3(q a.1B!=="p"){2.1H=a.1B}3(q a.1G!=="p"){2.S=a.1G}3(q a.1z!=="p"){2.H=a.1z}3(q a.1n!=="p"){2.17=a.1n}3(q a.U!=="p"){2.1q(a.U)}3(q a.13!=="p"){2.22(a.13)}3(q a.1C!=="p"){2.1E=a.1C}3(q a.1j!=="p"){2.P=a.1j}3(q a.1x!=="p"){2.1f=a.1x}3(q a.18!=="p"){2.w=a.18}3(q a.A!=="p"){2.w=!a.A}3(q a.1l!=="p"){2.16=a.1l}3(2.4){2.1y()}};8.9.1Q=7(a){2.Q=a;3(2.4){3(2.z){r.s.u.Y(2.z);2.z=t}3(!2.R){2.4.6.D=""}3(q a.1u==="p"){2.4.O=2.G()+a}v{2.4.O=2.G();2.4.1a(a)}3(!2.R){2.4.6.D=2.4.Z+"12";3(q a.1u==="p"){2.4.O=2.G()+a}v{2.4.O=2.G();2.4.1a(a)}}2.1w()}r.s.u.T(2,"2z")};8.9.1q=7(a){2.B=a;3(2.4){2.1y()}r.s.u.T(2,"21")};8.9.22=7(a){2.15=a;3(2.4){2.4.6.13=a}r.s.u.T(2,"2y")};8.9.2x=7(a){2.w=!a;3(2.4){2.4.6.M=(2.w?"1c":"A")}};8.9.2w=7(){K 2.Q};8.9.1A=7(){K 2.B};8.9.2v=7(){K 2.15};8.9.2u=7(){5 a;3((q 2.1D()==="p")||(2.1D()===t)){a=J}v{a=!2.w}K a};8.9.3i=7(){2.w=J;3(2.4){2.4.6.M="A"}};8.9.3j=7(){2.w=L;3(2.4){2.4.6.M="1c"}};8.9.2s=7(c,b){5 a=2;3(b){2.B=b.1A();2.14=r.s.u.2r(b,"21",7(){a.1q(2.1A())})}2.1N(c);3(2.4){2.1F()}};8.9.1r=7(){5 i;3(2.z){r.s.u.Y(2.z);2.z=t}3(2.E){1o(i=0;i<2.E.1L;i++){r.s.u.Y(2.E[i])}2.E=t}3(2.14){r.s.u.Y(2.14);2.14=t}3(2.V){r.s.u.Y(2.V);2.V=t}2.1N(t)};',62,210,'||this|if|div_|var|style|function|InfoBox|prototype||||||||||||||||undefined|typeof|google|maps|null|event|else|isHidden_|||closeListener_|visible|position_|parseInt|width|eventListeners_|boxStyle|getCloseBoxImg_|pixelOffset_|yOffset|false|return|true|visibility|currentStyle|innerHTML|closeBoxURL_|content_|fixedWidthSet_|maxWidth_|trigger|position|contextListener_|left|opacity|removeListener|offsetWidth||right|px|zIndex|moveListener_|zIndex_|enableEventPropagation_|alignBottom_|isHidden|addDomListener|appendChild|top|hidden|setBoxStyle_|document|infoBoxClearance_|bottom|new|stopPropagation|closeBoxURL|height|enableEventPropagation|boxStyle_|alignBottom|for|boxClass_|setPosition|close|defaultView|boxClass|nodeType|content|addClickHandler_|infoBoxClearance|draw|pixelOffset|getPosition|disableAutoPan|closeBoxMargin|getMap|closeBoxMargin_|panBox_|maxWidth|disableAutoPan_|pane_|cursor|push|length|click|setMap|mouseover|getBoxWidths_|setContent|OverlayView|borderRightWidth|borderLeftWidth|borderBottomWidth|borderTopWidth|getComputedStyle|100|Size|preventDefault|cancelBubble|position_changed|setZIndex|getProjection|offsetHeight|createInfoBoxDiv_|getBounds|getCloseClickHandler_|margin|pointer|relative|align|src|img|floatPane|domready|pane|infoBox|contextmenu|default|apply|touchmove|touchend|touchstart|dblclick|mouseup|mouseout|addListener|open|mousedown|getVisible|getZIndex|getContent|setVisible|zindex_changed|content_changed|auto|setOptions|fromLatLngToDivPixel|overflow|LatLng|removeChild|parentNode|onRemove|documentElement|getPanes|gif|ownerDocument|absolute|mapfiles|alpha|filter|div|Opacity|createElement|en_us|Alpha|Microsoft|DXImageTransform|progid|intl|MsFilter|returnValue|translateZ|WebkitTransform|com|hasOwnProperty|in|cssText|className|www|panBy|getCenter|http|fromLatLngToContainerPixel|arguments|getDiv|setCenter|2px|contains|show|hide|Map|instanceof|closeclick|firstChild'.split('|'),0,{})); // source --> https://healthpages.co.nz/wp-content/plugins/sabai-googlemaps/assets/js/sabai-googlemaps-map.min.js !function(e){SABAI.GoogleMaps=SABAI.GoogleMaps||{},SABAI.GoogleMaps.maps=SABAI.GoogleMaps.maps||{},SABAI.GoogleMaps.map=SABAI.GoogleMaps.map||function(o,a,i,t,n,r){var l,s,g,p,c,m,d,u,f,v,_=a.length,A=n.infobox_width||250,h=new InfoBox({boxClass:"sabai-googlemaps-infobox sabai-box-shadow",disableAutoPan:!1,closeBoxMargin:0,closeBoxURL:"https://www.google.com/intl/en_us/mapfiles/close.gif",infoBoxClearance:new google.maps.Size(30,30),pixelOffset:new google.maps.Size(-1*A/2,-55),alignBottom:!0,boxStyle:{width:A+"px"}}),w='
',b=[];if((l=e(o)).length){i?(i=new google.maps.LatLng(i[0],i[1]),0!=n.force_fit_bounds&&_>0&&(f=new google.maps.LatLngBounds)):(i=_?new google.maps.LatLng(a[0].lat,a[0].lng):new google.maps.LatLng(n.default_lat||40.69847,n.default_lng||-73.95144),_>1&&(f=new google.maps.LatLngBounds));for(v in google.maps.MapTypeId)b.push(google.maps.MapTypeId[v]);if(b.push("osm"),(s=new google.maps.Map(l.get(0),{mapTypeControl:!0,mapTypeId:-1!==e.inArray(l.data("map-type"),b)?l.data("map-type"):google.maps.MapTypeId.ROADMAP,mapTypeControlOptions:{style:google.maps.MapTypeControlStyle.DROPDOWN_MENU,mapTypeIds:b},panControl:!1,zoom:t,center:i,scrollwheel:0!=n.scrollwheel,styles:SABAI.GoogleMaps.styles||[{featureType:"poi",stylers:[{visibility:"off"}]}]})).mapTypes.set("osm",new google.maps.ImageMapType({getTileUrl:function(e,o){return"//a.tile.openstreetmap.org/"+o+"/"+e.x+"/"+e.y+".png"},tileSize:new google.maps.Size(256,256),isPng:!0,maxZoom:19,minZoom:0,name:"OSM"})),_>0){if(0!=n.marker_clusters){var k={maxZoom:15};n.marker_cluster_imgurl&&(k.imagePath=n.marker_cluster_imgurl+"/m"),m=new MarkerClusterer(s,[],k)}for(u=0;u<_;u++){if(c=new google.maps.LatLng(a[u].lat,a[u].lng),g=new google.maps.Marker({position:c}),(a[u].icon||n.icon)&&(d||(d={},parseInt(n.marker_width)&&parseInt(n.marker_height)&&(d.size=d.scaledSize=new google.maps.Size(parseInt(n.marker_width),parseInt(n.marker_height)))),d.url=a[u].icon||n.icon,g.setIcon(d)),f&&(f.extend(c),0!=n.force_fit_bounds&&f.extend(new google.maps.LatLng(2*i.lat()-a[u].lat,2*i.lng()-a[u].lng))),google.maps.event.addListener(g,n.marker_event||"click",function(e,o){return function(i){p&&p.get("id")===e.get("id")||(m&&i.triggered&&(s.setZoom(16),m.repaint()),p&&p.setAnimation(null),i.triggered&&!i.trigger_infobox||!a[o].content?(e.setAnimation(google.maps.Animation.BOUNCE),setTimeout(function(){e.setAnimation(null)},1400)):(h.setContent(w+a[o].content),h.open(s,e),p=e),s.panTo(e.getPosition()))}}(g,u)),a[u].trigger){var I=e(a[u].trigger);if(I.length){var y=a[u].triggerEvent||"mouseover";I[y](function(e,o,a,i,t){return function(){if("change"!==i||a.val()==o)return google.maps.event.trigger(e,n.marker_event||"click",{triggered:!0,trigger_infobox:t}),!1;""===a.val()&&h.close()}}(g,u,I,y,a[u].trigger_infobox))}}g.set("id",u),m?m.addMarker(g):g.setMap(s),void 0!==n.default_marker&&n.default_marker===u&&setTimeout(function(e){return function(){google.maps.event.trigger(e,n.marker_event||"click",{init:!0})}}(g),1500)}if(n.enable_directions){var B=e(n.enable_directions);if(!B.length)return;var M=B.find(".sabai-googlemaps-directions-trigger");if(!M.length)return;var S,L,x,T=B.find(".sabai-googlemaps-directions-panel"),C=new google.maps.DirectionsService;B.find(".sabai-googlemaps-directions-panel").hide().end().find(".sabai-googlemaps-directions-input").val("").end().find(".sabai-googlemaps-directions-destination").val(0),M.click(function(i){i.preventDefault();var t=e(this),n=B.find(".sabai-googlemaps-directions-destination").val();if(""!==n&&a[n]){var r=B.find(".sabai-googlemaps-directions-input").val();r&&(h.close(),t.addClass("sabai-disabled"),S=a[n],x={origin:r,destination:new google.maps.LatLng(S.lat,S.lng),travelMode:google.maps.TravelMode[t.data("travel-mode")||"DRIVING"]},T.html("").hide(),null!=L&&(L.setMap(null),L=null),L=new google.maps.DirectionsRenderer({map:s,draggable:!0,panel:T.get(0)}),C.route(x,function(e,a){a==google.maps.DirectionsStatus.OK?(L.setDirections(e),SABAI.scrollTo(o),T.show().find("img.adp-marker").hide()):alert("No directions found"),t.removeClass("sabai-disabled")}))}})}google.maps.event.addListener(h,"closeclick",function(){p=null}),google.maps.event.addListener(h,"clusteringbegin",function(){h.close(),p=null}),f&&s.fitBounds(f)}if(n.circle&&n.circle.center&&parseInt(n.circle.draw)){var D=new google.maps.Circle({strokeColor:n.circle.stroke_color||"#99f",strokeOpacity:.8,strokeWeight:1,fillColor:n.circle.fill_color||"#99f",fillOpacity:.3,map:s,center:new google.maps.LatLng(n.circle.center[0],n.circle.center[1]),radius:n.circle.is_mile?1609.344*n.circle.radius:1e3*n.circle.radius});f||s.fitBounds(D.getBounds())}if(r){var G=e(n.update_trigger||o+"-update");if(G.length){var O,z=function(){G.prop("checked")&&r.call(s,s.getCenter(),s.getBounds(),s.getZoom())};google.maps.event.addListener(s,"dragend",function(){O=setTimeout(z,1e3)}),google.maps.event.addListener(s,"mousedown",function(){O&&clearTimeout(O)}),e.cookie&&G.prop("checked",e.cookie("sabai_googlemaps_map_update")).click(function(){e(this).prop("checked")?e.cookie("sabai_googlemaps_map_update",!0,{expires:7,path:SABAI.path,domain:SABAI.domain}):e.removeCookie("sabai_googlemaps_map_update")})}}return SABAI.GoogleMaps.maps[o]=s,s}},SABAI.Directory=SABAI.Directory||{},SABAI.Directory.googleMap=function(e,o,a,i,t,n,r){SABAI.GoogleMaps.map(e,o,i,t,n,r,a)}}(jQuery); // source --> https://healthpages.co.nz/wp-content/plugins/sabai-googlemaps/assets/js/sabai-googlemaps-autocomplete.min.js !function(e){SABAI.GoogleMaps=SABAI.GoogleMaps||{},SABAI.GoogleMaps.autocomplete=SABAI.GoogleMaps.autocomplete||function(o,n){if("undefined"!=typeof google&&google.maps.places){var t=e(o);t.length&&(n=n||{},n.types=["geocode"],n.country&&(n.componentRestrictions=n.componentRestrictions||{},n.componentRestrictions.country=n.country),t.each(function(){var o=e(this).get(0);google.maps.event.addDomListener(o,"focus",function(t){var a=new google.maps.places.Autocomplete(o,n);n.markerMap&&a.addListener("place_changed",function(){e(n.markerMap).find(".sabai-googlemaps-find-on-map").click()})}),google.maps.event.addDomListener(o,"keydown",function(e){13==e.keyCode&&e.preventDefault()})}))}}}(jQuery); // source --> https://healthpages.co.nz/wp-content/plugins/sabai-googlemaps/assets/js/markerclusterer.min.js function ClusterIcon(a,b){a.getMarkerClusterer().extend(ClusterIcon,google.maps.OverlayView);this.cluster_=a;this.className_=a.getMarkerClusterer().getClusterClass();this.styles_=b;this.center_=null;this.div_=null;this.sums_=null;this.visible_=false;this.setMap(a.getMap())}ClusterIcon.prototype.onAdd=function(){var c=this;var a;var b;this.div_=document.createElement("div");this.div_.className=this.className_;if(this.visible_){this.show()}this.getPanes().overlayMouseTarget.appendChild(this.div_);this.boundsChangedListener_=google.maps.event.addListener(this.getMap(),"bounds_changed",function(){b=a});google.maps.event.addDomListener(this.div_,"mousedown",function(){a=true;b=false});google.maps.event.addDomListener(this.div_,"click",function(h){a=false;if(!b){var d;var f;var g=c.cluster_.getMarkerClusterer();google.maps.event.trigger(g,"click",c.cluster_);google.maps.event.trigger(g,"clusterclick",c.cluster_);if(g.getZoomOnClick()){f=g.getMaxZoom();d=c.cluster_.getBounds();g.getMap().fitBounds(d);setTimeout(function(){g.getMap().fitBounds(d);if(f!==null&&(g.getMap().getZoom()>f)){g.getMap().setZoom(f+1)}},100)}h.cancelBubble=true;if(h.stopPropagation){h.stopPropagation()}}});google.maps.event.addDomListener(this.div_,"mouseover",function(){var d=c.cluster_.getMarkerClusterer();google.maps.event.trigger(d,"mouseover",c.cluster_)});google.maps.event.addDomListener(this.div_,"mouseout",function(){var d=c.cluster_.getMarkerClusterer();google.maps.event.trigger(d,"mouseout",c.cluster_)})};ClusterIcon.prototype.onRemove=function(){if(this.div_&&this.div_.parentNode){this.hide();google.maps.event.removeListener(this.boundsChangedListener_);google.maps.event.clearInstanceListeners(this.div_);this.div_.parentNode.removeChild(this.div_);this.div_=null}};ClusterIcon.prototype.draw=function(){if(this.visible_){var a=this.getPosFromLatLng_(this.center_);this.div_.style.top=a.y+"px";this.div_.style.left=a.x+"px"}};ClusterIcon.prototype.hide=function(){if(this.div_){this.div_.style.display="none"}this.visible_=false};ClusterIcon.prototype.show=function(){if(this.div_){var a=this.getPosFromLatLng_(this.center_);this.div_.style.cssText=this.createCss(a);if(this.cluster_.printable_){this.div_.innerHTML="
"+this.sums_.text+"
"}else{this.div_.innerHTML=this.sums_.text}if(typeof this.sums_.title==="undefined"||this.sums_.title===""){this.div_.title=this.cluster_.getMarkerClusterer().getTitle()}else{this.div_.title=this.sums_.title}this.div_.style.display=""}this.visible_=true};ClusterIcon.prototype.useStyle=function(b){this.sums_=b;var a=Math.max(0,b.index-1);a=Math.min(this.styles_.length-1,a);var c=this.styles_[a];this.url_=c.url;this.height_=c.height;this.width_=c.width;this.anchor_=c.anchor;this.anchorIcon_=c.anchorIcon||[parseInt(this.height_/2,10),parseInt(this.width_/2,10)];this.textColor_=c.textColor||"black";this.textSize_=c.textSize||11;this.textDecoration_=c.textDecoration||"none";this.fontWeight_=c.fontWeight||"bold";this.fontStyle_=c.fontStyle||"normal";this.fontFamily_=c.fontFamily||"Arial,sans-serif";this.backgroundPosition_=c.backgroundPosition||"0 0"};ClusterIcon.prototype.setCenter=function(a){this.center_=a};ClusterIcon.prototype.createCss=function(b){var a=[];if(!this.cluster_.printable_){a.push("background-image:url("+this.url_+");");a.push("background-position:"+this.backgroundPosition_+";")}if(typeof this.anchor_==="object"){if(typeof this.anchor_[0]==="number"&&this.anchor_[0]>0&&this.anchor_[0]0&&this.anchor_[1]f){if(b.getMap()!==this.map_){b.setMap(this.map_)}}else{if(dd){this.clusterIcon_.hide();return}if(b0){return}for(b=0;b3){b=new google.maps.LatLngBounds(this.getMap().getBounds().getSouthWest(),this.getMap().getBounds().getNorthEast())}else{b=new google.maps.LatLngBounds(new google.maps.LatLng(85.02070771743472,-178.48388434375),new google.maps.LatLng(-85.08136444384544,178.00048865625))}var g=this.getExtendedBounds(b);var f=Math.min(a+this.batchSize_,this.markers_.length);for(e=a;e https://healthpages.co.nz/wp-content/plugins/sabai/assets/js/typeahead.bundle.min.js /*! * typeahead.js 0.10.5 * https://github.com/twitter/typeahead.js * Copyright 2013-2014 Twitter, Inc. and other contributors; Licensed MIT */ !function(a){var b=function(){"use strict";return{isMsie:function(){return/(msie|trident)/i.test(navigator.userAgent)?navigator.userAgent.match(/(msie |rv:)(\d+(.\d+)?)/i)[2]:!1},isBlankString:function(a){return!a||/^\s*$/.test(a)},escapeRegExChars:function(a){return a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},isString:function(a){return"string"==typeof a},isNumber:function(a){return"number"==typeof a},isArray:a.isArray,isFunction:a.isFunction,isObject:a.isPlainObject,isUndefined:function(a){return"undefined"==typeof a},toStr:function(a){return b.isUndefined(a)||null===a?"":a+""},bind:a.proxy,each:function(b,c){function d(a,b){return c(b,a)}a.each(b,d)},map:a.map,filter:a.grep,every:function(b,c){var d=!0;return b?(a.each(b,function(a,e){return(d=c.call(null,e,a,b))?void 0:!1}),!!d):d},some:function(b,c){var d=!1;return b?(a.each(b,function(a,e){return(d=c.call(null,e,a,b))?!1:void 0}),!!d):d},mixin:a.extend,getUniqueId:function(){var a=0;return function(){return a++}}(),templatify:function(b){function c(){return String(b)}return a.isFunction(b)?b:c},defer:function(a){setTimeout(a,0)},debounce:function(a,b,c){var d,e;return function(){var f,g,h=this,i=arguments;return f=function(){d=null,c||(e=a.apply(h,i))},g=c&&!d,clearTimeout(d),d=setTimeout(f,b),g&&(e=a.apply(h,i)),e}},throttle:function(a,b){var c,d,e,f,g,h;return g=0,h=function(){g=new Date,e=null,f=a.apply(c,d)},function(){var i=new Date,j=b-(i-g);return c=this,d=arguments,0>=j?(clearTimeout(e),e=null,g=i,f=a.apply(c,d)):e||(e=setTimeout(h,j)),f}},noop:function(){}}}(),c="0.10.5",d=function(){"use strict";function a(a){return a=b.toStr(a),a?a.split(/\s+/):[]}function c(a){return a=b.toStr(a),a?a.split(/\W+/):[]}function d(a){return function(){var c=[].slice.call(arguments,0);return function(d){var e=[];return b.each(c,function(c){e=e.concat(a(b.toStr(d[c])))}),e}}}return{nonword:c,whitespace:a,obj:{nonword:d(c),whitespace:d(a)}}}(),e=function(){"use strict";function c(c){this.maxSize=b.isNumber(c)?c:100,this.reset(),this.maxSize<=0&&(this.set=this.get=a.noop)}function d(){this.head=this.tail=null}function e(a,b){this.key=a,this.val=b,this.prev=this.next=null}return b.mixin(c.prototype,{set:function(a,b){var c,d=this.list.tail;this.size>=this.maxSize&&(this.list.remove(d),delete this.hash[d.key]),(c=this.hash[a])?(c.val=b,this.list.moveToFront(c)):(c=new e(a,b),this.list.add(c),this.hash[a]=c,this.size++)},get:function(a){var b=this.hash[a];return b?(this.list.moveToFront(b),b.val):void 0},reset:function(){this.size=0,this.hash={},this.list=new d}}),b.mixin(d.prototype,{add:function(a){this.head&&(a.next=this.head,this.head.prev=a),this.head=a,this.tail=this.tail||a},remove:function(a){a.prev?a.prev.next=a.next:this.head=a.next,a.next?a.next.prev=a.prev:this.tail=a.prev},moveToFront:function(a){this.remove(a),this.add(a)}}),c}(),f=function(){"use strict";function a(a){this.prefix=["__",a,"__"].join(""),this.ttlKey="__ttl__",this.keyMatcher=new RegExp("^"+b.escapeRegExChars(this.prefix))}function c(){return(new Date).getTime()}function d(a){return JSON.stringify(b.isUndefined(a)?null:a)}function e(a){return JSON.parse(a)}var f,g;try{f=window.localStorage,f.setItem("~~~","!"),f.removeItem("~~~")}catch(h){f=null}return g=f&&window.JSON?{_prefix:function(a){return this.prefix+a},_ttlKey:function(a){return this._prefix(a)+this.ttlKey},get:function(a){return this.isExpired(a)&&this.remove(a),e(f.getItem(this._prefix(a)))},set:function(a,e,g){return b.isNumber(g)?f.setItem(this._ttlKey(a),d(c()+g)):f.removeItem(this._ttlKey(a)),f.setItem(this._prefix(a),d(e))},remove:function(a){return f.removeItem(this._ttlKey(a)),f.removeItem(this._prefix(a)),this},clear:function(){var a,b,c=[],d=f.length;for(a=0;d>a;a++)(b=f.key(a)).match(this.keyMatcher)&&c.push(b.replace(this.keyMatcher,""));for(a=c.length;a--;)this.remove(c[a]);return this},isExpired:function(a){var d=e(f.getItem(this._ttlKey(a)));return b.isNumber(d)&&c()>d?!0:!1}}:{get:b.noop,set:b.noop,remove:b.noop,clear:b.noop,isExpired:b.noop},b.mixin(a.prototype,g),a}(),g=function(){"use strict";function c(b){b=b||{},this.cancelled=!1,this.lastUrl=null,this._send=b.transport?d(b.transport):a.ajax,this._get=b.rateLimiter?b.rateLimiter(this._get):this._get,this._cache=b.cache===!1?new e(0):i}function d(c){return function(d,e){function f(a){b.defer(function(){h.resolve(a)})}function g(a){b.defer(function(){h.reject(a)})}var h=a.Deferred();return c(d,e,f,g),h}}var f=0,g={},h=6,i=new e(10);return c.setMaxPendingRequests=function(a){h=a},c.resetCache=function(){i.reset()},b.mixin(c.prototype,{_get:function(a,b,c){function d(b){c&&c(null,b),k._cache.set(a,b)}function e(){c&&c(!0)}function i(){f--,delete g[a],k.onDeckRequestArgs&&(k._get.apply(k,k.onDeckRequestArgs),k.onDeckRequestArgs=null)}var j,k=this;this.cancelled||a!==this.lastUrl||((j=g[a])?j.done(d).fail(e):h>f?(f++,g[a]=this._send(a,b).done(d).fail(e).always(i)):this.onDeckRequestArgs=[].slice.call(arguments,0))},get:function(a,c,d){var e;return b.isFunction(c)&&(d=c,c={}),this.cancelled=!1,this.lastUrl=a,(e=this._cache.get(a))?b.defer(function(){d&&d(null,e)}):this._get(a,c,d),!!e},cancel:function(){this.cancelled=!0}}),c}(),h=function(){"use strict";function c(b){b=b||{},b.datumTokenizer&&b.queryTokenizer||a.error("datumTokenizer and queryTokenizer are both required"),this.datumTokenizer=b.datumTokenizer,this.queryTokenizer=b.queryTokenizer,this.reset()}function d(a){return a=b.filter(a,function(a){return!!a}),a=b.map(a,function(a){return a.toLowerCase()})}function e(){return{ids:[],children:{}}}function f(a){for(var b={},c=[],d=0,e=a.length;e>d;d++)b[a[d]]||(b[a[d]]=!0,c.push(a[d]));return c}function g(a,b){function c(a,b){return a-b}var d=0,e=0,f=[];a=a.sort(c),b=b.sort(c);for(var g=a.length,h=b.length;g>d&&h>e;)a[d]b[e]?e++:(f.push(a[d]),d++,e++);return f}return b.mixin(c.prototype,{bootstrap:function(a){this.datums=a.datums,this.trie=a.trie},add:function(a){var c=this;a=b.isArray(a)?a:[a],b.each(a,function(a){var f,g;f=c.datums.push(a)-1,g=d(c.datumTokenizer(a)),b.each(g,function(a){var b,d,g;for(b=c.trie,d=a.split("");g=d.shift();)b=b.children[g]||(b.children[g]=e()),b.ids.push(f)})})},get:function(a){var c,e,h=this;return c=d(this.queryTokenizer(a)),b.each(c,function(a){var b,c,d,f;if(e&&0===e.length)return!1;for(b=h.trie,c=a.split("");b&&(d=c.shift());)b=b.children[d];return b&&0===c.length?(f=b.ids.slice(0),void(e=e?g(e,f):f)):(e=[],!1)}),e?b.map(f(e),function(a){return h.datums[a]}):[]},reset:function(){this.datums=[],this.trie=e()},serialize:function(){return{datums:this.datums,trie:this.trie}}}),c}(),i=function(){"use strict";function d(a){return a.local||null}function e(d){var e,f;return f={url:null,thumbprint:"",ttl:864e5,filter:null,ajax:{}},(e=d.prefetch||null)&&(e=b.isString(e)?{url:e}:e,e=b.mixin(f,e),e.thumbprint=c+e.thumbprint,e.ajax.type=e.ajax.type||"GET",e.ajax.dataType=e.ajax.dataType||"json",!e.url&&a.error("prefetch requires url to be set")),e}function f(c){function d(a){return function(c){return b.debounce(c,a)}}function e(a){return function(c){return b.throttle(c,a)}}var f,g;return g={url:null,cache:!0,wildcard:"%QUERY",replace:null,rateLimitBy:"debounce",rateLimitWait:300,send:null,filter:null,ajax:{}},(f=c.remote||null)&&(f=b.isString(f)?{url:f}:f,f=b.mixin(g,f),f.rateLimiter=/^throttle$/i.test(f.rateLimitBy)?e(f.rateLimitWait):d(f.rateLimitWait),f.ajax.type=f.ajax.type||"GET",f.ajax.dataType=f.ajax.dataType||"json",delete f.rateLimitBy,delete f.rateLimitWait,!f.url&&a.error("remote requires url to be set")),f}return{local:d,prefetch:e,remote:f}}();!function(c){"use strict";function e(b){b&&(b.local||b.prefetch||b.remote)||a.error("one of local, prefetch, or remote is required"),this.limit=b.limit||5,this.sorter=j(b.sorter),this.dupDetector=b.dupDetector||k,this.local=i.local(b),this.prefetch=i.prefetch(b),this.remote=i.remote(b),this.cacheKey=this.prefetch?this.prefetch.cacheKey||this.prefetch.url:null,this.index=new h({datumTokenizer:b.datumTokenizer,queryTokenizer:b.queryTokenizer}),this.storage=this.cacheKey?new f(this.cacheKey):null}function j(a){function c(b){return b.sort(a)}function d(a){return a}return b.isFunction(a)?c:d}function k(){return!1}var l,m;return l=c.Bloodhound,m={data:"data",protocol:"protocol",thumbprint:"thumbprint"},c.Bloodhound=e,e.noConflict=function(){return c.Bloodhound=l,e},e.tokenizers=d,b.mixin(e.prototype,{_loadPrefetch:function(b){function c(a){f.clear(),f.add(b.filter?b.filter(a):a),f._saveToStorage(f.index.serialize(),b.thumbprint,b.ttl)}var d,e,f=this;return(d=this._readFromStorage(b.thumbprint))?(this.index.bootstrap(d),e=a.Deferred().resolve()):e=a.ajax(b.url,b.ajax).done(c),e},_getFromRemote:function(a,b){function c(a,c){b(a?[]:f.remote.filter?f.remote.filter(c):c)}var d,e,f=this;if(this.transport)return a=a||"",e=encodeURIComponent(a),d=this.remote.replace?this.remote.replace(this.remote.url,a):this.remote.url.replace(this.remote.wildcard,e),this.transport.get(d,this.remote.ajax,c)},_cancelLastRemoteRequest:function(){this.transport&&this.transport.cancel()},_saveToStorage:function(a,b,c){this.storage&&(this.storage.set(m.data,a,c),this.storage.set(m.protocol,location.protocol,c),this.storage.set(m.thumbprint,b,c))},_readFromStorage:function(a){var b,c={};return this.storage&&(c.data=this.storage.get(m.data),c.protocol=this.storage.get(m.protocol),c.thumbprint=this.storage.get(m.thumbprint)),b=c.thumbprint!==a||c.protocol!==location.protocol,c.data&&!b?c.data:null},_initialize:function(){function c(){e.add(b.isFunction(f)?f():f)}var d,e=this,f=this.local;return d=this.prefetch?this._loadPrefetch(this.prefetch):a.Deferred().resolve(),f&&d.done(c),this.transport=this.remote?new g(this.remote):null,this.initPromise=d.promise()},initialize:function(a){return!this.initPromise||a?this._initialize():this.initPromise},add:function(a){this.index.add(a)},get:function(a,c){function d(a){var d=f.slice(0);b.each(a,function(a){var c;return c=b.some(d,function(b){return e.dupDetector(a,b)}),!c&&d.push(a),d.length0||!this.transport)&&c&&c(f)},clear:function(){this.index.reset()},clearPrefetchCache:function(){this.storage&&this.storage.clear()},clearRemoteCache:function(){this.transport&&g.resetCache()},ttAdapter:function(){return b.bind(this.get,this)}}),e}(this);var j=function(){return{wrapper:'',dropdown:'',dataset:'
',suggestions:'',suggestion:'
'}}(),k=function(){"use strict";var a={wrapper:{position:"relative",display:"inline-block"},hint:{position:"absolute",top:"0",left:"0",borderColor:"transparent",boxShadow:"none",opacity:"1"},input:{position:"relative",verticalAlign:"top",backgroundColor:"transparent"},inputWithNoHint:{position:"relative",verticalAlign:"top"},dropdown:{position:"absolute",top:"100%",left:"0",zIndex:"100",display:"none"},suggestions:{display:"block"},suggestion:{whiteSpace:"nowrap",cursor:"pointer"},suggestionChild:{whiteSpace:"normal"},ltr:{left:"0",right:"auto"},rtl:{left:"auto",right:" 0"}};return b.isMsie()&&b.mixin(a.input,{backgroundImage:"url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)"}),b.isMsie()&&b.isMsie()<=7&&b.mixin(a.input,{marginTop:"-1px"}),a}(),l=function(){"use strict";function c(b){b&&b.el||a.error("EventBus initialized without el"),this.$el=a(b.el)}var d="typeahead:";return b.mixin(c.prototype,{trigger:function(a){var b=[].slice.call(arguments,1);this.$el.trigger(d+a,b)}}),c}(),m=function(){"use strict";function a(a,b,c,d){var e;if(!c)return this;for(b=b.split(i),c=d?h(c,d):c,this._callbacks=this._callbacks||{};e=b.shift();)this._callbacks[e]=this._callbacks[e]||{sync:[],async:[]},this._callbacks[e][a].push(c);return this}function b(b,c,d){return a.call(this,"async",b,c,d)}function c(b,c,d){return a.call(this,"sync",b,c,d)}function d(a){var b;if(!this._callbacks)return this;for(a=a.split(i);b=a.shift();)delete this._callbacks[b];return this}function e(a){var b,c,d,e,g;if(!this._callbacks)return this;for(a=a.split(i),d=[].slice.call(arguments,1);(b=a.shift())&&(c=this._callbacks[b]);)e=f(c.sync,this,[b].concat(d)),g=f(c.async,this,[b].concat(d)),e()&&j(g);return this}function f(a,b,c){function d(){for(var d,e=0,f=a.length;!d&&f>e;e+=1)d=a[e].apply(b,c)===!1;return!d}return d}function g(){var a;return a=window.setImmediate?function(a){setImmediate(function(){a()})}:function(a){setTimeout(function(){a()},0)}}function h(a,b){return a.bind?a.bind(b):function(){a.apply(b,[].slice.call(arguments,0))}}var i=/\s+/,j=g();return{onSync:c,onAsync:b,off:d,trigger:e}}(),n=function(a){"use strict";function c(a,c,d){for(var e,f=[],g=0,h=a.length;h>g;g++)f.push(b.escapeRegExChars(a[g]));return e=d?"\\b("+f.join("|")+")\\b":"("+f.join("|")+")",c?new RegExp(e):new RegExp(e,"i")}var d={node:null,pattern:null,tagName:"strong",className:null,wordsOnly:!1,caseSensitive:!1};return function(e){function f(b){var c,d,f;return(c=h.exec(b.data))&&(f=a.createElement(e.tagName),e.className&&(f.className=e.className),d=b.splitText(c.index),d.splitText(c[0].length),f.appendChild(d.cloneNode(!0)),b.parentNode.replaceChild(f,d)),!!c}function g(a,b){for(var c,d=3,e=0;e